<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditCustomerTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditCustomerLabel_id}" for="id" />
                    <h:inputText id="id" value="#{customerController.selected.id}" title="#{bundle.EditCustomerTitle_id}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_name}" for="name" />
                    <h:inputText id="name" value="#{customerController.selected.name}" title="#{bundle.EditCustomerTitle_name}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_name}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_address}" for="address" />
                    <h:inputText id="address" value="#{customerController.selected.address}" title="#{bundle.EditCustomerTitle_address}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_address}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_creditCard}" for="creditCard" />
                    <h:inputText id="creditCard" value="#{customerController.selected.creditCard}" title="#{bundle.EditCustomerTitle_creditCard}" />
                    <h:outputLabel value="#{bundle.EditCustomerLabel_society}" for="society" />
                    <h:inputText id="society" value="#{customerController.selected.society}" title="#{bundle.EditCustomerTitle_society}" />
                    <h:outputLabel value="#{bundle.EditCustomerLabel_registerDate}" for="registerDate" />
                    <h:inputText id="registerDate" value="#{customerController.selected.registerDate}" title="#{bundle.EditCustomerTitle_registerDate}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_registerDate}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_login}" for="login" />
                    <h:inputText id="login" value="#{customerController.selected.login}" title="#{bundle.EditCustomerTitle_login}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_login}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_password}" for="password" />
                    <h:inputText id="password" value="#{customerController.selected.password}" title="#{bundle.EditCustomerTitle_password}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_password}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_role}" for="role" />
                    <h:inputText id="role" value="#{customerController.selected.role}" title="#{bundle.EditCustomerTitle_role}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_role}"/>
                </h:panelGrid>
                <h:commandLink action="#{customerController.update}" value="#{bundle.EditCustomerSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditCustomerViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{customerController.prepareList}" value="#{bundle.EditCustomerShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditCustomerIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
